package oj.day42;

import java.util.Scanner;

public class 小红的子串 {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(),l = in.nextInt(),r = in.nextInt();
        char[] s = in.next().toCharArray();
        int left = 0,right = 0,count = 0;
        long x = 0,y = 0;
        int[] hash1 = new int[26];
        int[] hash2 = new int[26];
        while(right < n) {
            //进窗口
            if(hash1[s[right]-'a'] == 0) {
                count++;
            }
            hash1[s[right]-'a']++;
            //判断出窗口
            while(count > l-1) {
                hash1[s[left]-'a']--;
                if(hash1[s[left]-'a'] == 0) {
                    count--;
                }
                left++;
            }
            //窗口合法更新结果
            x += (long)(right-left+1);
            right++;
        }
        left = 0;right = 0;count = 0;
        while(right < n) {
            //进窗口
            if(hash2[s[right]-'a'] == 0) {
                count++;
            }
            hash2[s[right]-'a']++;
            //判断出窗口
            while(count > r) {
                hash2[s[left]-'a']--;
                if(hash2[s[left]-'a'] == 0) {
                    count--;
                }
                left++;
            }
            //窗口合法更新结果
            y += (long)(right-left+1);
            right++;
        }
        System.out.println(y-x);
    }
}
